<template>
	<div class="current-list">
		<div>
			<van-list v-model="loading" :finished="finished" finished-text="没有更多了">
				<div class="current-item" v-for="item in list" :key="item.id">
					<div class="content">
						<div class="title">
							{{item.Title}}
						</div>
						<div class="start-time">
							<span>开始时间:</span> {{item.StartTime}}
						</div>
						<div class="end-time">
							<span>结束时间:</span>{{item.EndTime}}
						</div>
						<div class="requirement">
							<span>要 &nbsp; &nbsp;&nbsp;&nbsp; 求:</span>暂无要求
						</div>
						<div class="tips">
							请提前5分钟登录
						</div>
					</div>
					<div class="enter" @click.stop="enterTest(item)">
						进入
					</div>
				</div>
			</van-list>

		</div>

		<!-- <uni-popup ref="alertDialog" :isMaskClick="false">
			<view class="pop">
				<view class="pop-body">
					{{content}}
				</view>
				<view class="pop-foot" @click="$refs.alertDialog.close()">
					确认
				</view>
			</view>
		</uni-popup> -->

		<!-- 首次进入考试弹框 -->
		<!-- <confirm-pop ref="popover"></confirm-pop> -->
	</div>
</template>

<script>
// import confirmPop from '@/components/confirm-popover.vue'
export default {
	components: {
		// confirmPop,
	},
	props: ["list", "loading", "finished",'sortId','batchId'],
	data() {
		return {
			content: "",
		};
	},
	methods: {
		enterTest(item) {
			// uni.reLaunch({
			// 	url: '/pages/testValid/testValid?id='+item.Id
			// })
			this.$router.push({
				name: "testValid",
				params: {
					id: item.Id,
				},
			});
			localStorage.setItem('activeSortId',this.sortId)
			localStorage.setItem('activeBatchId',this.batchId)
			window.console.log(item);
			// let is_first = uni.getStorageSync('isfirst')
			// console.log(is_first);
			// if (is_first !== false) {
			// 	// 首次进入需要身份认证
			// 	this.$refs.popover.open('center')
			// } else {
			// 	// 不是首次进入，直接去考试
			// 	uni.navigateTo({
			// 		url: '/pages/testValid/testValid?id=' + item.id
			// 	})

			// }
		},
	},
};
</script>

<style lang="scss">
@import "../../index.less";
</style>
